<%@page import="entities.Domain"%>
<%@page import="java.util.List"%>
<%@page import="entities.SiteConfig"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.ArrayList"%>
<%@ page contentType="text/xml;charset=UTF-8" language="java"%>
<%
	SiteConfig configs = (SiteConfig) request.getAttribute("config");
	List<Domain> domains = (List<Domain>) request.getAttribute("domains");
	String serverUrl = UrlHelper.getServerUrl(request);
%>
<?xml version="1.0" encoding="UTF-8"?>
  <rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
    <title><![CDATA[ <%=configs.getTitle() %>]]></title>
    <link><%=serverUrl %></link>
    <description><![CDATA[<%=configs.getMetaDescription() %>]]></description>
    <dc:language>en-ca</dc:language>
    <dc:creator>Google App Engine</dc:creator>
    <dc:rights>Copyright 2012</dc:rights>
    <admin:generatorAgent rdf:resource="<%=serverUrl %>/" />
    	<%
    	for(Domain domain : domains) 
		{
   		%>
	       <item>
	          <title><![CDATA[ <%=domain.getDomain()%> ]]></title>
	          <link><%=serverUrl %>/info/<%=domain.getDomain()%></link>
	          <guid><%=serverUrl %>/info/<%=domain.getDomain()%></guid>
	          <description><![CDATA[ 
	          <%=domain.getDescription()%>
	          ]]></description>
	      	  <pubDate>
	      	  	<%=domain.getUpdated()%>
	      	  </pubDate>
	       </item>
      	<%
   		}
       	%>
    </channel>
</rss>  